<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
		//声明一个不定参数的函数，计算所有传入参数的和。
		// function sum() {
		// 	let sum = 0;
		// 	for (let i in arguments) {
		// 	sum += arguments[i];
		// 	 }
		// 	return sum;
		// }
		function sum(a, b) {
			console.log(arguments);//连带打印出length，参数等等
			return a + b;
		}
		
		console.log(sum(1, 2))
		console.log(sum(1,10))
		console.log(sum(10, 14))
		</script>
	</body>
</html>
